package com.acsior.hibernate.vo;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.ddfn.impl.hibernate.vo.NomElementVO;

/**
 * PostalService entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "postal_services", uniqueConstraints = { @UniqueConstraint(columnNames = {
		"system_name", "mo_service_id" }) })
@GeneratorKey(tableName = "postal_services")
public class PostalServiceVO extends NomElementVO {

	private static final long serialVersionUID = -599859353918603098L;

	@Column(name = "active", nullable = false)
	private boolean active;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "postalService")
	private List<BuildingAttributeVO> buildingAttributes;

	@Column(name = "court_fees", nullable = false)
	private boolean courtFees;

	@Column(name = "executed_IG", nullable = false)
	private boolean executedByIG;

	@Column(name = "expense", nullable = false)
	private boolean expense;

	@Column(name = "fiscal_amount", nullable = false, scale = 4)
	private double fiscalAmount;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "postService")
	private List<FiscalizationLinkVO> fiscalizations;

	@Column(name = "interests", nullable = false)
	private boolean interests;

	@Column(name = "marketing_dependend", nullable = false)
	private boolean marketingDependend;

	@Column(name = "mnemonic_code", nullable = true, length = 50)
	private String mnemonicCode;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "mo_service_id")
	private PostalServiceVO moService;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_service_subgroup_id", nullable = false)
	private NomServiceSubgroupVO nomServiceSubgroup;

	@Column(name = "partially", nullable = false)
	private boolean partially;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "postalService")
	private List<PostalServiceSupplementVO> postalServiceSupplements;

	/** default constructor */
	public PostalServiceVO() {
		this.buildingAttributes = new ArrayList<BuildingAttributeVO>();
		this.fiscalizations = new ArrayList<FiscalizationLinkVO>();
	}

	/**
	 * @return the buildingAttributes
	 */
	public List<BuildingAttributeVO> getBuildingAttributes() {
		return this.buildingAttributes;
	}

	/** @return the fiscalAmount */
	public double getFiscalAmount() {
		return this.fiscalAmount;
	}

	/**
	 * @return стойността на fiscalizations
	 */
	public List<FiscalizationLinkVO> getFiscalizations() {
		return this.fiscalizations;
	}

	/**
	 * @return the mnemonicCode
	 */
	public String getMnemonicCode() {
		return this.mnemonicCode;
	}

	/** @return the moService */
	public PostalServiceVO getMoService() {
		return this.moService;
	}

	/** @return the nomServiceSubgroup */
	public NomServiceSubgroupVO getNomServiceSubgroup() {
		return this.nomServiceSubgroup;
	}

	/**
	 * @return the postalServiceSupplements
	 */
	public List<PostalServiceSupplementVO> getPostalServiceSupplements() {
		return this.postalServiceSupplements;
	}

	/**
	 * @return the active
	 */
	public boolean isActive() {
		return this.active;
	}

	/**
	 * @return the courtFees
	 */
	public boolean isCourtFees() {
		return this.courtFees;
	}

	/**
	 * @return the executedByIG
	 */
	public boolean isExecutedByIG() {
		return this.executedByIG;
	}

	/** @return the expense */
	public boolean isExpense() {
		return this.expense;
	}

	/**
	 * @return the interests
	 */
	public boolean isInterests() {
		return this.interests;
	}

	/** @return the marketingDependend */
	public boolean isMarketingDependend() {
		return this.marketingDependend;
	}

	/**
	 * @return the partially
	 */
	public boolean isPartially() {
		return this.partially;
	}

	/**
	 * @param active
	 *            the active to set
	 */
	public void setActive(boolean active) {
		this.active = active;
	}

	/**
	 * @param buildingAttributes
	 *            the buildingAttributes to set
	 */
	public void setBuildingAttributes(List<BuildingAttributeVO> buildingAttributes) {
		this.buildingAttributes = buildingAttributes;
	}

	/**
	 * @param courtFees
	 *            the courtFees to set
	 */
	public void setCourtFees(boolean courtFees) {
		this.courtFees = courtFees;
	}

	/**
	 * @param executedByIG
	 *            the executedByIG to set
	 */
	public void setExecutedByIG(boolean executedByIG) {
		this.executedByIG = executedByIG;
	}

	/**
	 * @param expense
	 *            the expense to set
	 */
	public void setExpense(boolean expense) {
		this.expense = expense;
	}

	/**
	 * @param fiscalAmount
	 *            the fiscalAmount to set
	 */
	public void setFiscalAmount(double fiscalAmount) {
		this.fiscalAmount = fiscalAmount;
	}

	/**
	 * @param fiscalizations
	 *            се залага в fiscalizations
	 */
	public void setFiscalizations(List<FiscalizationLinkVO> fiscalizations) {
		this.fiscalizations = fiscalizations;
	}

	/**
	 * @param interests
	 *            the interests to set
	 */
	public void setInterests(boolean interests) {
		this.interests = interests;
	}

	/**
	 * @param marketingDependend
	 *            the marketingDependend to set
	 */
	public void setMarketingDependend(boolean marketingDependend) {
		this.marketingDependend = marketingDependend;
	}

	/**
	 * @param mnemonicCode
	 *            the mnemonicCode to set
	 */
	public void setMnemonicCode(String mnemonicCode) {
		this.mnemonicCode = mnemonicCode;
	}

	/**
	 * @param moService
	 *            the moService to set
	 */
	public void setMoService(PostalServiceVO moService) {
		this.moService = moService;
	}

	/**
	 * @param nomServiceSubgroup
	 *            the nomServiceSubgroup to set
	 */
	public void setNomServiceSubgroup(NomServiceSubgroupVO nomServiceSubgroup) {
		this.nomServiceSubgroup = nomServiceSubgroup;
	}

	/**
	 * @param partially
	 *            the partially to set
	 */
	public void setPartially(boolean partially) {
		this.partially = partially;
	}

	/**
	 * @param postalServiceSupplements
	 *            the postalServiceSupplements to set
	 */
	public void setPostalServiceSupplements(List<PostalServiceSupplementVO> postalServiceSupplements) {
		this.postalServiceSupplements = postalServiceSupplements;
	}
}